package com.sylar.happygps;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class UserRegisterActivity extends Activity implements OnClickListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.userreg);

		Button btn_title_left = (Button) findViewById(R.id.btn_title_left);
		btn_title_left.setVisibility(View.VISIBLE);
		btn_title_left.setText("用户中心");
		btn_title_left.setOnClickListener(this);

		Button btn_help = (Button) findViewById(R.id.btn_help);
		btn_help.setVisibility(View.VISIBLE);
		btn_help.setOnClickListener(this);

		TextView tv_title_name = (TextView) findViewById(R.id.tv_title_name);
		tv_title_name.setVisibility(View.VISIBLE);
		tv_title_name.setText("用户注册");

		View btn_check_email = findViewById(R.id.btn_check_email);
		btn_check_email.setOnClickListener(this);
		View btn_check_userid = findViewById(R.id.btn_check_userid);
		btn_check_userid.setOnClickListener(this);
		
		View btn_reg_email_help = findViewById(R.id.btn_reg_email_help);
		btn_reg_email_help.setOnClickListener(this);
		View btn_reg_ecode_help = findViewById(R.id.btn_reg_ecode_help);
		btn_reg_ecode_help.setOnClickListener(this);
		View btn_reg_nickname_help = findViewById(R.id.btn_reg_nickname_help);
		btn_reg_nickname_help.setOnClickListener(this);
		View btn_reg_uid_help = findViewById(R.id.btn_reg_uid_help);
		btn_reg_uid_help.setOnClickListener(this);
		View btn_reg_upass_help = findViewById(R.id.btn_reg_upass_help);
		btn_reg_upass_help.setOnClickListener(this);
	}

	private void toHelpActivity(){
		Intent intent = new Intent(this,HelpActivity.class);
		startActivity(intent);
	}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_title_left:
			finish();
			break;
		case R.id.btn_help:
		case R.id.btn_reg_email_help:
		case R.id.btn_reg_ecode_help:
		case R.id.btn_reg_nickname_help:
		case R.id.btn_reg_uid_help:
		case R.id.btn_reg_upass_help:
			toHelpActivity();
			break;
		case R.id.btn_check_userid:
			Toast.makeText(getApplicationContext(), "点击了验证", 0).show();
			break;
		case R.id.btn_check_email:
			Toast.makeText(getApplicationContext(), "点击了验证", 0).show();
			break;

		default:
			break;
		}
	}
}
